package com.zzyl.task;

import com.zzyl.service.CustomerReservationService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

/**
 * @author sjqn
 */
@Component
@Slf4j
public class MyTask {

    @Autowired
    private CustomerReservationService customerReservationService;

    /**
     * 定时任务 每隔5秒触发一次
     */
    //@Scheduled(cron = "0 10 * * * ?")
    public void executeTask(){
        log.info("定时任务开始执行：{}", LocalDateTime.now());
        customerReservationService.executeTask();
    }
}